package jalus.utils;

public class MineType {
	public static final String gif = "image/gif";
	public static final String jpg = "image/jpeg ";
	public static final String png = "image/png";
	public static final String file = "application/octet-stream";
	public static final String html = "text/html";
	public static final String text = "text/plain";
	
	public static String getMineTypeByFileName(String fileName){
		if(fileName.endsWith(".gif")){
			return gif;
		}else if(fileName.endsWith(".png")){
			return png;
		}else if(fileName.endsWith("jpg") || fileName.endsWith("jpeg")){
			return jpg;
		}else{
			return file;
		}
	}
	
	public static boolean isImage(String mimeType){
		return mimeType.startsWith("image/");
	}
}
